package com.java.proxy;

public class ProxyTest implements Person{
    @Override
    public void sayHello(String content, int age) {
        System.out.println("Proxy Test sayHello begin");
        o.sayHello(content,age);
        System.out.println("Proxy Test sayHello end");
    }

    @Override
    public void sayGoodBye(boolean seeAgain, double time) {
        System.out.println("ProxyTest sayGoodBye begin");
        o.sayGoodBye(seeAgain,time);
        System.out.println("ProxyTest sayGoodBye end");

    }

    private Person o;

    public ProxyTest(Person o){
        this.o = o;
    }

    public static void main(String[] args){
        Student s = new Student();
        ProxyTest proxyTest = new ProxyTest(s);
        proxyTest.sayHello("Welcome to Java",20);
        System.out.println("-----------");
        proxyTest.sayGoodBye(true,100);
    }
}
